home *** CD-ROM | disk | FTP | other *** search
- /*
- param line
-
- Draw a line with n dots
- Modify n: the number of dots on the line
-
- */
-
-
- address 'rexx_TVPaint'
-
- parse ARG m x1 y1 x2 y2 b
- if(m~='Line')then
- do
- tv_warn 'I need LINE parameters'
- exit
- end
-
-
- n=5
-
-
- tv_UpdateUndo
- x=x1
- y=y1
-
- tv_dot x y
- if (n<2) then n=2
-
- iy=1
- dy=y2-y1
- if (dy<0) then
- do
- dy=-dy
- iy=-1
- end
-
-
- ix=1
- dx=x2-x1
- if (dx<0) then
- do
- dx=-dx
- ix=-1
- end
-
- cl=1
-
- if (dx>dy) then
- do
- l=dx%(n-1)
- d=dx
- do while (x~==x2)
-
- x=x+ix
- d=d-dy
-
- if (d<0) then
- do
- y=y+iy
- d=d+dx
- end
-
- if(cl=l) then
- do
- tv_dot x y
- cl=0
- end
- cl=cl+1
- end
- end
- else
- do
- l=dy%(n-1)
- d=dy
- do while (y ~==y2)
-
- y=y+iy
- d=d-dx
-
- if (d<0) then
- do
- x=x+ix
- d=d+dy
- end
-
- if(cl=l) then
- do
- tv_dot x y
- cl=0
- end
- cl=cl+1
- end
- end
-
-
-